package demo22;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sr=new Scanner(System.in);
        int n=sr.nextInt();
        int a=1;
        for (int i = 0; i < n; i++) {
            for (int j = i; j <n ; j++) {
                System.out.printf("%4d",a++);
            }
            System.out.println();
        }
    }
}
